package org.jet.emall.prod.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jet.emall.common.restful.result.CommonResult;
import org.jet.emall.config.AllServersConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-04-15 15:56
 */
@RestController
@Api(value = "公共Controller",tags = "公共操作接口")
public class PublicController {


    @Autowired
    private AllServersConfig allServersConfig;




    @ApiOperation(value = "获取图片下载服务器地址")
    @RequestMapping(value="/publics/imageserver",method = RequestMethod.GET)
    public CommonResult<String> getImageServerBaseUrl(){
        String imageServer = allServersConfig.getImageServer();
        return CommonResult.success(imageServer,"获取图片服务器地址成功");
    }
}
